-
Notifications
You must be signed in to change notification settings - Fork 752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --ci
mode to uv cache prune
#5391
Conversation
b758cbc
to
d0108ea
Compare
c912530
to
149fb26
Compare
remove_dir(path)?; | ||
} else { | ||
remove_file(path)?; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bug. We have handling for this below (for entries), but not for the top-level thing we passed to rm_rf
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
crates/uv-cli/src/lib.rs
Outdated
/// cache may have a negative impact on cache performance. Pruning unzipped wheels will leave | ||
/// the cache with any built wheels in their zipped form. | ||
#[arg(long)] | ||
pub all_unzipped: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about calling it --ci
and documenting it as keeping only the artifacts you want to upload to the CI cache?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a user perspective, I do feel this would be the main use-case. It would also make it immediately clear to me that I probably should use this in CI pipelines.
--all-unzipped
to uv cache prune
--ci
mode to uv cache prune
149fb26
to
50ba902
Compare
50ba902
to
7ba49f2
Compare
Would you be interested in adding documentation for this to:
It could be brief. |
Yeah I can. |
Summary
Users can now run
uv cache prune --ci
(open to feedback on the name of that flag) to remove all pre-built wheels from the cache, leaving behind zipped, built wheels (which tend to be the most expensive assets to re-create). This should greatly increase cache performance in CI environments, since uploading unzipped wheels can actually hurt performance if you're persisting the uv cache.Closes #5282.